#!/usr/bin/python
## peace of mind
## creates pickle for sanity
## author huseyin
## some example datafor generic asp managers
import pickle as pickle

def main():
	structure={}
	structure['adslcounter']={
	'root':[['adslcounter','command']],
	'command':['save','restore',['query','query0']],
	'query0':['rx','tx','month_index']
	}
	structure['bridge_vlan']={
	'root':[['bridge_vlan','command']],
	'command':['delete_bridge','apply','stop',['get','get0'],['set','set0'],['query','query0']],
	'get0':['settings','ifaces',['iface_index','iface_index'],['iface_name','iface_index']],
	'iface_index':['%ifaces'],
	'set0':['vlanid','name','active','ismgmt','addIface','alterIface','delIface','delIfaceIndex',],
	'query0':['checkTagging',]
	}
	structure['conn']={
	'root':[['conn','command']],
	'get0':['enabled','conns','conn_limit','hostname'],
	'set0':['enabled','conn_limit','state','hostname'],
	'command':['restart','stop','apply',['get','get0'],['set','set0'],['query','query0']],
	'query0':['net_dev_stats']
	}
	structure['dhcps']={
	'root':[['dhcps','command']],
	'get0':['options','settings','clients','static_ip'],
	'set0':['name','iface','startip','endip','subnet','gw','dns','lease_time','enabled','add_option','del_option','optionid','optionname','optionval','add_client','del_client'],
	'command':['restart','stop','apply',['get','get0'],['set','set0'],['query','query0']],
	'query0':['leases','lease']
	}
	structure['dhcprelay']={
	'root':[['dhcprelay','command']],
	'command':['apply',['get','get0'],['set','set0'],['query','query0']],
	'get0':['settings'],
	'set0':[['state','bool'],'connection_lan','connection_wan','server_ip'],
	'bool':['0','1'],
	'query0':['localip','remoteip','netmask']
	}
	structure['dhcpc']={
	'root':[['dhcpc','command']],
	'command':['restart','renew','apply','release',['query','query0']],
	'query0':['localip','remoteip','netmask']
	}
	structure['eth_hw_acc']={
	'root':[['eth_hw_acc','command']],
	'command':[['get','get0'],['set','get0']],
	'get0':['enable']
	}
	structure['event']={
	'root':[['event','command']],
	'command':[['query','query0']],
	'query0':['generic_events','events_of']
	}
	structure['diagnotic']={
	'root':[['diagnostic','command']],
	'command':['apply','restart','stop','ping',['get','get0'],['set','set0']],
	'get0':['settings'],
	'set0':['iface','host','count','block_size','ping'],
	}
	structure['ddns']={
	'root':[['ddns','command']],
	'command':['restart','apply','stop',['get','get0'],['set','set0'],['query','query0']],
	'get0':['settings','enabled','server_ids',['server','common0',]],
	'common0':[['%server_ids','common1']],
	'common1':['active','hostname','service','username','password','interval'],
	'set0':['enabled','new_server','del_server',['server','common0',]],
	'query0':['active_servers','server_count','new_server_id','daemon_state','server']
	}
	structure['pppox']={
	'root':[['pppox','command']],
	'command':['restart','apply','stop','start',['enable_debug','bool'],['get','get0'],['set','set0'],['query','query0']],
	'bool':['true','false'],
	'get0':['settings'],
	'set0':[['type','types'],'username','password','mtu','lcp_echo_interval','lcp_echo_failure','on_demand','idle','connection_delay','connection_delay_inc'],
	'types':['pppoe','pppoa'],
	'query0':['state','connectionDuration','connectionTime','exitReason','connectionStatus','lastConnectionError',]
	}
	structure['failover']={
	'root':[['failover','command']],
	'command':['start','apply','stop','connect_3g','restart',['get','get0'],['set','set0']],
	'get0':['settings','handover_wait_time','initial_wait_time','force3g','uiconfirm','failovervoice'],
	'set0':['enabled','handover_wait_time','initial_wait_time','force3g','uiconfirm','failovervoice'],
	}
	structure['http_upgrade']={
	'root':[['http_upgrade','command']],
	'command':['apply','updatefw',['get','get0'],['set','get0'],['query','query0']],
	'get0':['backOffTimeInMin','nextUpdateTime','isEnabled','defercount','updateserver'],
	'query0':['checkforupgrade','checkstatus','checkfwversion']
	}
	structure['igmpproxy']={
	'root':[['igmpproxy','command']],
	'command':['apply','restart','stop',['enable_debug','bool'],['get','get0'],['set','get0']],
	'bool':['0','1'],
	'get0':['enabled','snooping','quickleave','upiface','altnet_list','downstream_list'],
	'set0':['enabled','snooping','quickleave','upifname','upthreshold','upratelimit','downifname','downthreshold','downratelimit','add_iface','del_iface','add_altnet','del_altnet','change_altnet'],
	}
	structure['igmpsnoop_bridge']={
	'root':[['igmpsnoop_bridge','command']],
	'command':['restart','start','stop','apply','vlan_disable','vlan_enable',['get','get0'],['set','get0'],['query','query0']],
	'get0':['enabled','vlan'],
	'set0':['enabled','delete_vlan','add_vlan','set_vlan-'],
	'query0':['pre_query','post_query',',iface_count','get_iface','get_group','get_client']
	}
	structure['lan']={
	'root':[['lan','command']],
	'command':['apply',['get','get0'],['set','get0']],
	'get0':[['settings','types']],
	'types':['dhcpc','static'],
	'set0':['bridge','static','dhcpc',['type','types']],
	}
	structure['sysmgr']={
	'root':[['sysmgr','command']],
	'command':['reboot','apply_user_info','unmount_all','apply',['get','get0'],['set','get0'],['query','query0']],
	'query0':['getenv','product_id','product_name','productboardtype','fwversion','buildserver','uptime','currtime','feature','reboot_req'],
	'get0':['password','eco0146'],
	'set0':['password','PRODUCT_CLASS','eco0146',],
	}
	structure['voice']={
	'root':[['voice','command']],
	'command':['restart','apply','stop','relay_on','relay_off','stop_tone','play_dtmf','play_voice','start_ring_phone','stop_ring_phone','pcm_link_on','pcm_link_off','daa_link_on','daa_link_off','test_on','test_off','enable_local_debug','disable_local_debug','rereg_request',['get','get0'],['set','set0'],['query','query0']],
	'get0':[['VoiceService','vc'],'voice','trace','traceTarget','PhyInterfaceList','PrefixInfoList','DialPlanList','CodecListWithEntries','LineList','AllLineList','GlobalServerList','LineServerList','GlobalServersNumber','LineServersNumber','PortList','EventList','Interface','DslPhoneNumber',],
	'vc':[['VoiceProfile','vp']],
	'vp':[['Line[0]','line'],['Line[1]','line']],
	'line':['Enable','PhyReferenceList',['SIP','sip']],
	'sip':[['Server[0]','server'],'UserAgentDomain','UserAgentPort','InviteExpires','RegistrationPeriod','RegisterRetryInterval','AuthUserName','AuthPassword','URI'],
	'server':['Enable','ProxyServer','ProxyServerPort','RegistrarServer','RegistrarServerPort','OutboundProxy','OutboundProxyPort'],
	'common0':[['%server_ids','common1']],
	'common1':['active','hostname','service','username','password','interval'],
	'set0':[['VoiceService','vc']],
	'query0':['status','speedDialSupport','callFeaturesSupport','loglength','callhistory']
	}

	pickle.dump(structure,open( "structure.pickle", "wb" ))
	print "cli structure created in structure.pickle"

if __name__ == '__main__':
        main()
